package com.ronx.scs.service;


import com.ronx.scs.dao.RegistryDAO;
import com.ronx.scs.model.Registry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Service(value = "registry")
public class RegistryServiceImpl implements RegistryService {

    @Autowired
    private RegistryDAO registryDAO;

    @PostConstruct
    public void init() throws Exception {
    }

    @PreDestroy
    public void destroy() {
    }

//    @Transactional(propagation= Propagation.REQUIRED, rollbackFor=Exception.class)
    public void add(Registry registry) {
        registryDAO.add(registry);
    }

//    @Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class)
    public void update(Registry registry) {
        registryDAO.update(registry);
    }

//    @Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class)
    public void delete(Registry registry) {
        registryDAO.delete(registry);
    }

//    public List<Registry> getByNumber(String number) {
//        return registryDAO.getByNumber(number);
//    }
//
//    public List<Registry> getByOwner(String owner) {
//        return registryDAO.getByOwner(owner);
//    }


    public Registry findById(int registryId) {
        return null;
    }

}
